//
//  UITableView+TableSectionHeaderText.m
//  PlotMate
//
//  Created by Brian Boyle on 10/04/2012.
//  Copyright (c) 2012 Brian Boyle. All rights reserved.
//

#import "UITableView+TableSectionHeaderText.h"
#import <QuartzCore/QuartzCore.h>

@implementation UITableView (TableSectionHeaderText)

/*Create a label with a font and shadow and add it to a UIView. 
 This is a custom view used for table section headers*/
+(UIView *)createSectionHeaderTextLabel:(NSString *)headerName
{
    UILabel *label = [[UILabel alloc] init];
    label.frame = CGRectMake(25, 10, 284, 23);
    label.textColor = [UIColor blackColor];
    label.font = [UIFont fontWithName:@"Sketch Rockwell" size:24];
    label.text = headerName;
    label.textColor = [UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:1];
    label.shadowColor = [UIColor blackColor];
    label.shadowOffset = CGSizeMake(1, 1);
    
    label.backgroundColor = [UIColor clearColor];

    
    // Create header view and add label as a subview
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(20, 0, 320, 10)];
    [view addSubview:label];
    return view;
}

@end
